package fuza.android.thetrafficsigns.help;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
import fuza.android.thetrafficsigns.DBHandler;
import fuza.android.thetrafficsigns.R;
import fuza.android.thetrafficsigns.Rambu;

public class SingleItemView extends Activity {
	// Declare Variables
	ImageView txtimg;
	TextView txtcountry;
	TextView txtpopulation;
	String img;
	String country;
	String population;
	
	String id;
	
	List<Rambu> dataList;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.singleitemview);
		
		DBHandler db = new DBHandler(this);
		
		Bundle extras = getIntent().getExtras();
		id = extras.getString("id");
		Log.d("id", id);
		Rambu p = db.getDetailS(id);

		// Locate the TextViews in singleitemview.xml
		txtimg = (ImageView) findViewById(R.id.txtimg);
		txtcountry = (TextView) findViewById(R.id.country);
		txtpopulation = (TextView) findViewById(R.id.population);

		// Load the results into the TextViews
		txtimg.setImageResource(this.getResources().getIdentifier(p.getN_gambar().replace(".png", ""), "drawable", "fuza.android.thetrafficsigns"));
		txtcountry.setText(p.getDesc_rambu());
		txtpopulation.setText(p.getJenis_rambu());
	}
}